package game;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.Rectangle;


public class Enemy {

	private Image image;
	
	private int x , y ;
	
	public int getX() {
		return x;
	}

	public void setX(int x) {
		this.x = x;
	}

	public int getY() {
		return y;
	}

	public void setY(int y) {
		this.y = y;
	}

	public boolean active;
	Rectangle rectPipe = new Rectangle();
	
	public Enemy(Image image) {

		this.image = image;
		//this.y = 350 * y;
		
		rectPipe = new Rectangle(image.getWidth(null), image.getHeight(null));
	
	}
	
	public void update(){
		
		x -=10;
		if (x < - image.getWidth(null)) {
			active = false;
		}	
	}
	
	public void render(Graphics g){
		
		g.drawImage(image, x, y, null);
		
	}
	
	public Rectangle getArea() {
		rectPipe.x = x;
		rectPipe.y = y;
		rectPipe.width  = image.getWidth(null);
		rectPipe.height= image.getHeight(null);
		
		return rectPipe;
	}
	
}
